#include<reg52.h>
#include"car.h"


int time=0;

void forword()
{
  time++;
  if(time==70)
  {EN1=1;EN2=1;
  IN1=0;IN2=1;IN3=1;IN4=0;}
  else if(time==100)
  {EN1=0;EN2=0;time=0;}
}

void back()
{
  time++;
  if(time==70)
  {EN1=1;EN2=1;
  IN1=1;IN2=0;IN3=1;IN4=0;}
  else if(time==100)
  {EN1=0;EN2=0;time=0;}
  
}

void left()
{
  time++;
  if(time==70)
  {EN1=0;EN2=1;
  IN1=0;IN2=0;IN3=1;IN4=0;}
  else if(time==100)
  {EN1=0;EN2=0;time=0;}

  
  
}

void right()
{
  time++;
  if(time==70)
  {EN1=1;EN2=0;
  IN1=0;IN2=1;IN3=0;IN4=0;}
  else if(time==100)
  {EN1=0;EN2=0;time=0;}
  
}